package cn.iocoder.yudao.module.wms.dal.mysql.pomain;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wms.dal.dataobject.pomain.PomainDO;
import cn.iocoder.yudao.module.wms.dal.dataobject.pomain.PomainsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wms.controller.admin.pomain.vo.*;

/**
 * 采购订单主 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PomainMapper extends BaseMapperX<PomainDO> {

    default PageResult<PomainDO> selectPage(PomainPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PomainDO>()
                .likeIfPresent(PomainDO::getCode, reqVO.getCode())
                .betweenIfPresent(PomainDO::getDdate, reqVO.getDdate())
                .eqIfPresent(PomainDO::getCmemo, reqVO.getCmemo())
                .betweenIfPresent(PomainDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(PomainDO::getCheckTime, reqVO.getCheckTime())
                .eqIfPresent(PomainDO::getCheckBy, reqVO.getCheckBy())
                .orderByDesc(PomainDO::getId)
                .eqIfPresent(PomainDO::getCdepId,reqVO.getCdepId())
                .eqIfPresent(PomainDO::getCvenId,reqVO.getCvenId())
                .eqIfPresent(PomainDO::getCpersonId,reqVO.getCpersonId())
        );
    }

    void updatePomainStatus(PomainSaveReqVO pomainSaveReqVO);
    PomainDO findByProcessInstanceId(String processInstanceId);
    int findCountByCode(String code);
    List<PomainsRespVO> findPomainsByPid(Integer pid);
    PomainsRespVO findPomainsById(Integer id);

    void updatePomains(PomainsRespVO pomainsDO);

    List<PomainsRespVO> findPomainsOperateList(Integer pid);
    List<PomainsRespVO> getPomainsOperateListByParams(PomainsRespVO pomainsRespVO);


    List<PomainDO>findPomainOperateList();

}